The Absolute Beginners Guide To Amos ------------------------------------- Chapter nine ------------ Here are the answers from the self test quiz in chapter eight: 1. A 6. C 2. B 7. A 3. C 8. C 4. C 9. B 5. B 10. B If you got less than five correct, re-read the relevant chapters. -------------------------------------------------------------------- Since we have covered quite a lot of ground I think it`s about time we concentrated for a while on some programming that will be of a bit more practical use, although we still have a lot of commands to learn. EXAMPLE9.Amos Is a small piece of code that will LOAD an IFF picture and a TRACKer module, display the picture and PLAY the mod. When any key is pressed by the user the music will stop and the contents of the memory banks of Amos will be displayed. All this probably sounds like we have a long program coming up, not so, we could fit the whole program on one line if we wanted to. EXAMPLE9.Amos ------------- HIDE LOAD IFF "DF0:PICS/SONIC.IFF",0 TRACK LOAD "DF0:MUSIC/MOD.FUN",5 TRACK PLAY 5 TRACK LOOP ON CLEAR KEY WAIT KEY TRACK STOP LISTBANK And that is it, neat isn`t it? HIDE ---- HIDE the mouse pointer as it`s not needed. LOAD IFF "DF0:PICS/SONIC.IFF",0 -------------------------- Well covered in an earlier chapter, LOADs an IFF picture into screen 0. TRACK LOAD "DF0:MUSIC/MOD.FUN",5 ---------------------------- A new one, the TRACK LOAD command LOADs a TRACKer module into the memory bank number defined by you after the comma. In this case I used bank five. Don`t worry why, we will be covering memory banks soon enough. NOTE: If TRACK LOAD throws up a syntax error chances are you are using an old out of date version of Amos as the TRACKer commands were only implemented in V1.34+ of the original Amos package. I am not sure about Easy Amos as I do not own a copy of that, but you will be OK with Amos Pro. If you do have problems with this you can get an updater disk from most P.D libraries. At the time of writing I am using V1.36 of Amos original. NOTE 2: There is a bug in the TRACK LOAD command that forces you to include the DF0: or DF1: statement at the start like this: TRACK LOAD "DF0: etc. If you don`t put it you will get an error. This applies to Amos original. I am not sure about the other versions. TRACK PLAY 5 ------------ This is the command that actually PLAYs the TRACKer music, there are more options you can add to TRACK PLAY but we don`t need to go into that here. The 5 is the bank we loaded the Tracker mod into. TRACK LOOP ON ------------- AS default TRACK LOOP is set to OFF so the module will only play once and then stop. To make the module LOOP continuously we simply set TRACK LOOP ON the opposite to this command is TRACK LOOP OFF. I think there may also be a bug as some mods I have tried will not loop correctly. CLEAR KEY --------- Is a simple but very useful command. CLEAR KEY, CLEARs the keyboard buffer of any KEY presses currently stored there. This doesn`t sound that fantastic until you start writing a program to detect key presses. You don`t really need to understand what it does just remember to use CLEAR KEY before any WAIT KEY instruction from now on. WAIT KEY -------- We know all about this, WAITs for any KEY press. TRACK STOP ---------- Can you guess what this does? Yes it STOPs the TRACKer music playing. LISTBANK -------- This command is one you wouldn`t normally use inside a program, it`s a system command really, it displays a LIST of any memory BANKs currently used in your program and you should have a display looking something like this: 5 - TRACKER S : $0005664 L : $00000678 Or similar. This information tells us that bank 5 five contains a tracker module the S is the start address of the bank and the number after the L is the length of the bank, the numbers are in Hexadecimal, we will not be covering Hex in this tutorial as it is of limited use to the beginner. If you were writing a program and wished to check how many banks you had in use or whatever, the normal practice would be to press escape and type in LISTBANK. The point of me putting LISTBANK at the end of the program is to introduce you to the concept of banks gently. Now load up Example9.Amos and read through the listing. Run it a few times and try getting the program to load one of your own pictures and mods. If you don't have any pictures lying around then try loading the different pictures on this disk. They are inside the PICS drawer. To find out what pictures are in the PICS drawer press escape then type in: DIR"df0:PICS/" And press return. End of chapter nine ^^^^^^^^^^^^^^^^^^^